Skip to content

[Win32] Remove obsolete codePage parameter from TCHAR constructors#3362

Open
HeikoKlare wants to merge 1 commit into
eclipse-platform:masterfrom
HeikoKlare:hk/win32-remove-tchar-codepage-param
Open

[Win32] Remove obsolete codePage parameter from TCHAR constructors#3362
HeikoKlare wants to merge 1 commit into
eclipse-platform:masterfrom
HeikoKlare:hk/win32-remove-tchar-codepage-param

Conversation

@HeikoKlare
Copy link
Copy Markdown
Contributor

@HeikoKlare HeikoKlare commented Jun 4, 2026

Summary

The TCHAR.codePage parameter has been silently ignored since Win9x/ANSI support was dropped. All Win32 calls in SWT use Unicode APIs exclusively, so the parameter was vestigial.

  • Remove codePage from all four TCHAR constructors
  • Update call sites
  • Remove the dead Control.getCodePage() method (it unconditionally returned OS.CP_ACP = 0)
  • Remove the dead OS.CP_ACP = 0x0 constant
  • Remove local cp/codePage variables that existed solely to pass to TCHAR constructors
  • Update the TCHAR class Javadoc to reflect its actual purpose as a null-terminated char[] buffer for Win32 Unicode APIs

🤖 Generated with Claude Code

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

Test Results (win32)

   30 files  ±0     30 suites  ±0   6m 9s ⏱️ +25s
4 704 tests ±0  4 629 ✅ ±0  75 💤 ±0  0 ❌ ±0 
1 234 runs  ±0  1 210 ✅ ±0  24 💤 ±0  0 ❌ ±0 

Results for commit 6ff6a99. ± Comparison against base commit c42bbab.

♻️ This comment has been updated with latest results.

@HeikoKlare HeikoKlare force-pushed the hk/win32-remove-tchar-codepage-param branch from d2397f5 to c77d695 Compare June 6, 2026 07:16
The TCHAR.codePage parameter has been ignored since Win9x support was
dropped. All call sites passed 0 (OS.CP_ACP) or the result of
Control.getCodePage() which unconditionally returned OS.CP_ACP = 0.

Remove the parameter from all four TCHAR constructors and update the
call sites. Also remove the now-dead Control.getCodePage() method, the
OS.CP_ACP constant, and the local cp/codePage variables that existed
solely to supply the argument.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

# Conflicts:
#	bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Button.java
#	bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Group.java
#	bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TableColumn.java
# Conflicts:
#	bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Button.java
@HeikoKlare HeikoKlare force-pushed the hk/win32-remove-tchar-codepage-param branch from c77d695 to 6ff6a99 Compare June 6, 2026 07:50
@HeikoKlare HeikoKlare marked this pull request as ready for review June 6, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant